home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / dnssd / domainbrowser.h next >
Encoding:
C/C++ Source or Header  |  2005-11-08  |  2.7 KB  |  106 lines

  1. /* This file is part of the KDE project
  2.  *
  3.  * Copyright (C) 2004 Jakub Stachowski <qbast@go2.pl>
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Library General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Library General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU Library General Public License
  16.  * along with this library; see the file COPYING.LIB.  If not, write to
  17.  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.  * Boston, MA 02110-1301, USA.
  19.  */
  20.  
  21. #ifndef DNSSDDOMAINBROWSER_H
  22. #define DNSSDDOMAINBROWSER_H
  23.  
  24. #include <qobject.h>
  25. #include <qdict.h>
  26. #include <dnssd/remoteservice.h>
  27.  
  28. // KIPC message ID used by kcm module to signal change in browsing domains list
  29.  
  30. #define KIPCDomainsChanged 2014
  31.  
  32. class QStringList;
  33. namespace DNSSD
  34. {
  35. class DomainBrowserPrivate;
  36.  
  37. /**
  38. @short Class used to provide current list of domains for browsing.
  39. @author Jakub Stachowski
  40. */
  41. class KDNSSD_EXPORT DomainBrowser : public QObject
  42. {
  43.     Q_OBJECT
  44. public:
  45.     /**
  46.     Standard constructor. It takes all parameters from global configuration.
  47.     All changes in configuration are applied immediately.
  48.     @param parent Parent object.
  49.      */
  50.     DomainBrowser(QObject *parent=0);
  51.     
  52.     /**
  53.     Constructor that creates browser for domain list. This does not use global
  54.     configuration at all.
  55.     @param domains List of domains 
  56.     @param recursive TRUE - additionally local network will be browsed for more domains
  57.     @param parent Parent object.
  58.     This process is recursive.
  59.      */
  60.     DomainBrowser(const QStringList& domains, bool recursive=false, QObject *parent=0);
  61.  
  62.     ~DomainBrowser();
  63.     
  64.     /**
  65.     Current list of domains to browse.
  66.      */
  67.     const QStringList& domains() const;
  68.     
  69.     /**
  70.     Starts browsing. To stop destroy this object.
  71.      */
  72.     void startBrowse() ;
  73.     
  74.     /**
  75.     Returns true when browse has already started
  76.      */
  77.     bool isRunning() const;
  78.  
  79. signals:
  80.     /**
  81.     Emitted when domain has been removed from browsing list
  82.      */
  83.     void domainRemoved(const QString&);
  84.     /**
  85.     New domain has been discovered. Also emitted for domain specified in constructor
  86.     and in global configuration
  87.      */
  88.     void domainAdded(const QString&);
  89.  
  90. protected:
  91.     virtual void virtual_hook(int,void*);
  92. private:
  93.     friend class DomainBrowserPrivate;
  94.     DomainBrowserPrivate *d;
  95.  
  96.     void gotNewDomain(const QString&);
  97.     void gotRemoveDomain(const QString&);
  98.  
  99. private slots:
  100.     void domainListChanged(int,int);
  101. };
  102.  
  103. }
  104.  
  105. #endif
  106.